package com.gy.def.service.impl;

import com.gy.def.dataobject.BookTable;
import com.gy.def.repository.BookRepository;
import com.gy.def.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

@Service
public class BookImpl implements BookService {
  @Autowired
  private BookRepository bookRepository;

  @Override
  public BookTable save(BookTable bt) {
    return bookRepository.save(bt);
  }

  @Override
  public BookTable findByBookName(String bookName) {
    return bookRepository.findByBookName(bookName);
  }

  @Override
  public Page<BookTable> findByIsDelete(int isDelete, Pageable pageable) {
    return bookRepository.findByIsDelete(isDelete, pageable);
  }

  @Override
  public BookTable findByBookId(String bookId) {
    return bookRepository.findByBookId(bookId);
  }

  @Override
  public Page<BookTable> findByBookUserId(String bookUserId, Pageable pageable) {
    return bookRepository.findByBookUserId(bookUserId, pageable);
  }
}
